<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');


	/**
	 * Creates a URL friendly string.
	 *
	 * Replaces multiple and single spaces with a single hyphen.
	 * All non-alphanumeric characters are removed.
	 */
	function create_alias ($string)
	{
		$pattern = '/\s+/';
		$string = preg_replace($pattern, '-', $string);
		$pattern = '/[^a-zA-Z0-9-]/';
		$string = preg_replace($pattern, '', $string);
		return strtolower($string);
	}


?>